﻿/**************************** DEPRECATED FUNCTIONS *****************************************/
/* Get the number of moves. */
function getMoves()
{
	if ( wave.getState() )
	{
		return parseInt( wave.getState().get( "moves", "0" ) );
	}
	else
	{
		return 0;
	}
}

function fillingAccount(Participants,account){
	var howManyTotla_t="";
	for ( par = 0; par < Participants.length; par++ ){
		var name=Participants[par].getDisplayName();
		var id=Participants[par].getId();	
		var count=0;
		forEachCell(function(row,col){if (account[row][col]==id) count++;});
		var square_t=count==1?" square":" squares";
		var howMany_t=name+" filled "+count+square_t;
		var howManyTotla_t=howManyTotla_t+"\n"+howMany_t+". ";
	}
	return howManyTotla_t;
}

/* Update the display of number of moves. */
function refreshMoves( gameState )
{
	var moves   = getMoves();
	var moves_t = moves == 1 ? "move" : "moves";
	var counter= isDone(gameState);
	var counter_t= counter==1?" game ":" games ";

	document.getElementById( "moves" ).innerHTML =
		"After " + moves + " " + moves_t + " You still have "+ counter+counter_t+ "left to fill.";
	document.getElementById( "Who" ).innerHTML = fillingAccount(wave.getParticipants(),accountState());

}

function resetGame()
{	
	answer = confirm("Do you really want to Reset");
	doReset(answer);

}

/******** NEW FUNTIONS **********************************/


		


	


